Explicitly set the a11y role of tooltip windows
authorMatthias Clasen <mclasen@redhat.com>
Wed, 18 Feb 2015 22:25:05 +0000 (17:25 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 18 Feb 2015 22:28:08 +0000 (17:28 -0500)
This seems better than trying to identify the 'tooltipness'
of the window on the other side.

https://bugzilla.gnome.org/show_bug.cgi?id=744683

gtk/gtktooltip.c

index ea762102b6edf1786670df23a1c7515ff44789ec..30c7333f74418efe9613952616350ec53791d77d 100644 (file)
@@ -35,6 +35,7 @@
 #include "gtksizerequest.h"
 #include "gtkstylecontext.h"
 #include "gtkwindowprivate.h"
+#include "gtkaccessible.h"
 
 
 #ifdef GDK_WINDOWING_WAYLAND
@@ -170,6 +171,7 @@ gtk_tooltip_init (GtkTooltip *tooltip)
   GtkWidget *box;
   GtkWidget *image;
   GtkWidget *label;
+  AtkObject *atk_obj;
 
   tooltip->timeout_id = 0;
   tooltip->browse_mode_timeout_id = 0;
@@ -195,6 +197,10 @@ gtk_tooltip_init (GtkTooltip *tooltip)
   context = gtk_widget_get_style_context (window);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLTIP);
 
+  atk_obj = gtk_widget_get_accessible (window);
+  if (GTK_IS_ACCESSIBLE (atk_obj))
+    atk_object_set_role (atk_obj, ATK_ROLE_TOOL_TIP);
+
   /* FIXME: don't hardcode the padding */
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
   gtk_widget_set_margin_start (box, 6);